<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page trimDirectiveWhitespaces="true"%>

<table id="table1">
	<c:forEach var="row" varStatus="counter" items="${requestScope.table}">
		<c:if test="${row.header}">
			<thead>
		</c:if>
		<tr>
			<c:choose>
				<c:when test="${not row.header}">
					<td><input id="select${row.key}" name="group" value="${row.key}" type="checkbox" /></td>
				</c:when>
				<c:otherwise>
					<th></th>
				</c:otherwise>
			</c:choose>
			<c:forEach var="column" items="${row.column}">
				<c:choose>
					<c:when test="${not row.header}">
						<td><c:out value="${column.content}" /></td>
					</c:when>
					<c:otherwise>
						<th><c:out value="${column.content}" /></th>
					</c:otherwise>
				</c:choose>
			</c:forEach>
		</tr>
		<c:if test="${row.header}">
			</thead>
			<tbody>
		</c:if>
	</c:forEach>
	</tbody>
</table>